Skip to content

Comments

feat: add --slide-visibility and --skip-hidden options for hidden slide handling#91

Open
eercanayar wants to merge 1 commit intossine:masterfrom
eercanayar:feature/slide-visibility
Open

feat: add --slide-visibility and --skip-hidden options for hidden slide handling#91
eercanayar wants to merge 1 commit intossine:masterfrom
eercanayar:feature/slide-visibility

Conversation

@eercanayar
Copy link

Summary

Adds two new flags for handling hidden slides in PowerPoint presentations:

  • --slide-visibility - Inserts HTML comments (<!-- Status: hidden --> or <!-- Status: visible -->) for each slide
  • --skip-hidden - Excludes hidden slides from the output while preserving original slide numbering

Motivation

This helps with:

  • Identifying hidden slides in the converted markdown (e.g., draft slides, backup content)
  • Filtering out hidden slides when you only want visible presentation content
  • Maintaining slide number accuracy when skipping hidden slides (original numbering preserved)

Complements #90 (slide numbers) - together they provide complete slide metadata in the output.

Changes

  • Added slide_visibility: bool = False and skip_hidden: bool = False to ConversionConfig
  • Added --slide-visibility and --skip-hidden CLI arguments
  • Added is_hidden: bool and original_index: int fields to GeneralSlide and MultiColumnSlide
  • Added hidden slide detection via slide._element.get('show') == '0' in parser
  • Added put_slide_visibility() method to Formatter base class
  • Updated both Formatter.output() and QuartoFormatter.output() to use it

Example Output

With --slide-visibility:

<!-- Status: hidden -->
# Draft Slide

Content here...

---

<!-- Status: visible -->
# Published Slide

More content...

With --skip-hidden (hidden slides excluded, numbering preserved for use with --slide-numbers):

<!-- Slide 3 -->
# First Visible Slide

Content...

Testing

Tested with a 269-slide presentation containing hidden slides - correctly identifies and handles all hidden/visible states in both MD and QMD formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant